import Vue from 'vue'
import VueRouter from 'vue-router'

// import Home from '../views/Home/index.vue'
// import Login from '../views/Login/index.vue'

// import Game from '../views/Home/components/Game/Game.vue'
// import Music  from '../views/Home/components/Music/Music.vue'
// import New from '../views/Home/components/News/New.vue'

const Home=()=>import("../views/Home/index.vue")
const Login =()=>import("../views/Login/index.vue")
const Game=()=>import("../views/Home/components/Game/Game.vue")
const Music=()=>import("../views/Home/components/Music/Music.vue")
const New=()=>import("../views/Home/components/News/New.vue")
const Item=()=>import("../views/Home/components/Game/Item/Item.vue")

Vue.use(VueRouter);
export default new VueRouter({
    
    routes:[
        {
            path:"/home",
            component:Home,
           
            children:[
                
               {
                path:"Game",
                component:Game,
                name:"Game",
                children:[
                    {
                        path:"Item",
                        component:Item,
                        name:"Item",
            //             * 
            //     我们可以在路由表中配置props属性,属性的值是一个布尔值true
            //     默认会把当前路由组件接受的动态路由params参数通过props的形式传递给组件内部
            //   */
                       props:true
                    }
                ]
               },
               {
                path:"Music",
                component:Music,
                name:"Music"

               },
               {
                path:"New",
                component:New,
                name:"New"
               },
            //    默认子路由配置方式1
               {
                path:"/",
                redirect:"/home/New"

               }
           
            ]
        },
        {
            path:"/Login",
            component:Login
        },
        //匹配默认路由
        {
            path:"/",
            redirect:"/home"
        }
        
    ]
})